<%-- 
    Document   : user_form
    Created on : Jan 25, 2013, 3:11:28 PM
    Author     : owtee
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<script type="text/javascript" src="../js/user.js"></script>

<table align="center" border="0">
    <c:forEach items="${mesLst}" var="message">
        <tr>
            <td colspan="2">${message.getMesDetail()}</td>
        </tr>
    </c:forEach> 
    <tr>
        <td colspan="2">User<hr></td>
    </tr>
    <tr>
        <td>User ID :</td>
        <td>
            <input class="inputbox" type="text" id="txtUserId" name="txtUserId" value="${user.getUserId()}"/>
        </td>
    </tr> 
    <tr>
        <td>Password :</td>
        <td>
            <input class="inputbox" type="password" id="txtUserPwd" name="txtUserPwd" value="${user.getUserPwd()}"/>
        </td>
    </tr> 
    <tr>
        <td>Re Password :</td>
        <td>
            <input class="inputbox" type="password" id="txtUserRePwd" name="txtUserRePwd" value="${user.getUserPwd()}" />
        </td>
    </tr>
    <tr>
        <td>บริษัท :</td>
        <td>
            <select id="ddlCom" name="ddlCom" onchange="reqDivAndDep()">
                <option value="">--- กรุณาเลือก ---</option>
                <c:forEach items="${comLst}" var="com">
                    <option value="${com.getComId()}" <c:if test="${com.getComId() == user.getComId().getComId()}">selected</c:if>>
                        ${com.getComName()}
                    </option>
                </c:forEach>
            </select>
        </td>
    </tr>
    <tr>
        <td>หน่วยงาน :</td>
        <td>
            <select id="ddlDiv" name="ddlDiv">
                <option value="">--- กรุณาเลือก ---</option>   
                <c:forEach items="${diviLst}" var="divi">
                    <option value="${divi.getDivId()}" <c:if test="${divi.getDivId() == user.getDivId().getDivId()}">selected</c:if>>
                        ${divi.getDivName()}
                    </option>
                </c:forEach>
            </select>
        </td>
    </tr>
    <tr>
        <td>แผนก :</td>
        <td>
            <select id="ddlDep" name="ddlDep">
                <option value="">--- กรุณาเลือก ---</option>   
                <c:forEach items="${depLst}" var="dep">
                    <option value="${dep.getDepId()}" <c:if test="${dep.getDepId() == user.getDepId().getDepId()}">selected</c:if>>
                        ${dep.getDepName()}
                    </option>
                </c:forEach>
            </select>
        </td>
    </tr>
    <tr>
        <td>ชื่อ :</td>
        <td>
            <input class="inputbox" type="text" id="txtFirstName" name="txtFirstName" value="${user.getEmpFirstName()}" />
        </td>
    </tr> 
    <tr>
        <td>นามสกุล :</td>
        <td>
            <input class="inputbox" type="text" id="txtLastName" name="txtLastName" value="${user.getEmpLastName()}" />
        </td>
    </tr> 
    <tr>
        <td>โทรศัพท์ :</td>
        <td>
            <input class="inputbox" type="text" id="txtTelephone" name="txtTelephone" value="${user.getTelephone()}" onkeypress="checknum()" maxlength="10"/>
            
        </td>
    </tr> 
    <tr>
        <td>&nbsp;</td>
        <td>
            <input type="checkbox" id="chkAdminFlag" name="chkAdminFlag" value="true" <c:if test="${user.getAdminFlag() == 'true'}">checked</c:if>/> Admin
            <input type="checkbox" id="chkMsgFlag" name="chkMsgFlag" value="true" <c:if test="${user.getMsgFlag() == 'true'}">checked</c:if>/> Messenger
        </td>
    </tr> 
    <tr>
        <td colspan="2" style="text-align: center">
            <input type="submit" value="Save" />            
            <input type="button" value="Cancel" onclick="location.href='UserGetAll'"/>
        </td>                        
    </tr>
</table>
